import { defineStore } from 'pinia'

export const useTarbarStore = defineStore('useTarbarStore', {
  state: () => {
    return {
      tarbarIndex: 0,
    }
  },

  /**
   * 用来封装计算属性 有缓存功能  类似于computed
   */
  getters: {},

  /**
   * 编辑业务逻辑  类似于methods
   */
  actions: {
    changeTarbarIndex(index: number) {
      this.tarbarIndex = index
    },
  },

  persist: {
    enabled: true,
  },
})
